package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class OupputStreamWriterTest {
    public static void main(String[] args) {
        System.out.println(System.in.getClass());
        FileOutputStream fileOutputStream = null;
        OutputStreamWriter outputStreamWriter=null;
        BufferedWriter bufferedWriter=null;
        try {
      fileOutputStream = new FileOutputStream("d:/5.txt");
      outputStreamWriter = new OutputStreamWriter(fileOutputStream, StandardCharsets.UTF_16);
      bufferedWriter = new BufferedWriter(outputStreamWriter);
      bufferedWriter.write("我不好");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                bufferedWriter.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
